package com.CusterRelSys.control;

import com.CusterRelSys.entity.CstLost;
import com.CusterRelSys.service.LostServiceLZY;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * Created by Administrator on 2017/12/1.
 */
@Controller
@RequestMapping("/cstLost")
public class CstLostControlLZY {
    @Autowired
    LostServiceLZY lostServiceLZY;
    /*
    *加载客户流失分析表
    */
    @RequestMapping("/selectLostBy")
    public String selectLostBy(HttpSession session,String lstCustName,String lstCustManagerName)
    {
        System.out.println("传入的custName："+lstCustName);
        System.out.println("传入的lstCustManagerName："+lstCustManagerName);

        CstLost cstLost=new CstLost();
        cstLost.setLstCustName(lstCustName);
        cstLost.setLstCustManagerName(lstCustManagerName);
        List<CstLost> cstLostList=lostServiceLZY.selectLostBy(cstLost);
        for (CstLost cstLosts : cstLostList) {
            System.out.println(cstLosts);
        }
        session.setAttribute("cstLostList",cstLostList);
        return "Views/~rept/lost";
    }
}
